#pragma once
#include <string>
#include <XnCppWrapper.h>
class NIBase
{
public:
	NIBase();
	virtual ~NIBase();
	bool Initialize( int width = 640,int height = 480,int fps = 30 );
	void Update();
protected:
	//For subclass to initialize other content
	virtual bool InitContent() = 0;
	//For subclass to update other content
	virtual void UpdateContent() = 0;
	//Check error
	bool CheckOpenNIError( XnStatus eResult, std::string sStatus = "no message" );
protected:
	xn::Context		m_Context;
	xn::DepthGenerator	m_DepthGenerator;
	xn::ImageGenerator	m_ImageGenerator;
	xn::UserGenerator		m_UserGenerator;

	xn::DepthMetaData		m_DepthData;
	xn::ImageMetaData		m_ColorData;

	XnMapOutputMode		m_MapMode;
	XnUInt16			m_nUsers;
};

